Skip to main content

Use Case Diagram

It represents the system's functional requirements from an end-user's perspective and the interactions between actors (users or external systems) and a system to achieve specific goals. It gather the system needs and depicts the external view of the system.

Components:

  • Actors: External entities (users, systems) that interact with the system.
  • Use Cases: Functions or services the system provides.
  • Relationships: Shows how actors interact with use cases.
    • Association: Connects actors to use cases, indicating that an actor participates in a use case.
    • Include: A relationship where a use case is always included as part of another use case.
    • Extend: Indicates optional behavior that extends the functionality of a use case.
  • System Boundary: Defines the scope of the system being modeled.

Example

Merge this two diagram and build one single diagram.

+-----------------------------------------+
| Library Management System |
|-----------------------------------------|
| |
| Student/Member |
| ├── Search Book |
| ├── Borrow Book |
| | └── (include) Search Book |
| ├── Return Book |
| | └── (extend) Pay Fine |
| ├── Reserve Book |
| └── Pay Fine |
| |
| Librarian |
| ├── Issue Book |
| | └── (include) Search Book |
| ├── Receive Returned Book |
| ├── Manage Book Records |
| └── Manage Member Records |
| |
| Admin |
| ├── Generate Reports |
| └── Add Librarian |
| |
+-----------------------------------------+

+-----------------------------------------+
| Library Management System |
+-----------------------------------------+
| [Search Book] |
| [Borrow Book] | <-- include --> [Search Book]
| [Return Book] | <-- extend --> [Pay Fine]
| [Reserve Book] |
| [Pay Fine] |
| [Manage Book Records] |
| [Issue Book] | <-- include --> [Search Book]
| [Receive Returned Book] |
| [Manage Member Records] |
| [Generate Reports] |
| [Add Librarian] |
+-----------------------------------------+
^ ^ ^
/ | \
Student/Member Librarian Admin